#pragma once
class MutableBuffer
{
public:
	MutableBuffer(void);
	~MutableBuffer(void);

	void setBuffer(const void* newBuffer,int newBufferSize);
	void setBuffer(const MutableBuffer* buffer);
	void addBuffer(const MutableBuffer* buffer);
	void addBuffer(const void* newBuffer,int newBufferSize);
	void clear();

	unsigned int bufferSize() const;//all buffer size
	unsigned char* buffer() const;//all buffer
	unsigned char* allocBuffer() const;//all buffer

	unsigned int cursoredBufferSize() const;
	bool getCursoredBuffer(MutableBuffer* buffer,float percentageOfAllBuffer);

private:
	unsigned char* m_buffer;  
	unsigned int m_bufferSize;  

	unsigned int m_cursor;
};

